Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allowed catch without variable #309

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

i582
Copy link
Contributor

@i582 i582 commented Sep 11, 2021

RFC: https://wiki.php.net/rfc/non-capturing_catches

A catch without a variable is a catch with the without_variable
flag set and with a variable with an autogenerated name. This variable
is further used as a placeholder.

At the stage of code generation, if the without_variable flag is set,
then we simply destroy the current exception, thereby handling it.

#290

A 'catch' without a variable is a catch with the 'without_variable'
flag set with a variable with an autogenerated name. This variable
is further used as a placeholder.

At the stage of code generation, if the 'without_variable' flag is set,
then we simply destroy the current exception, thereby handling it.

The gain in this case is in the absence of moving the current exception
into a temp variable, which, according to benchmarks, however, gives an
increase in speed within the margin of error for simple Exception.
@i582 i582 added the PHP8 PHP8 feature label Sep 11, 2021
@Tsygankov-Slava Tsygankov-Slava mentioned this pull request Jul 3, 2023
44 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PHP8 PHP8 feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant